package com.copm.ifm.base.service.config;

import com.copm.ifm.base.basic.constant.IfmConstants;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * ifm平台配置参数
 *
 * @author zzf
 * @date 2021/6/10 13:51
 */
@Setter
@ConfigurationProperties(prefix = IfmConstants.PROPERTY_PREFIX)
public class IfmProperties {

    @NestedConfigurationProperty
    public ComponentEnabled enabled;

    @NestedConfigurationProperty
    public SwaggerProperties swagger;

    @NestedConfigurationProperty
    public ProjectProperties project;


    @Setter
    public static class ProjectProperties {

        /**
         * 模块名
         */
        public String serverName;

    }


    @Setter
    public static class SwaggerProperties {

        /**
         * 界面标题
         */
        public String title;

        /**
         * 界面描述
         */
        public String description;

        /**
         * 需要扫描的controller类包路径
         */
        public String basePackage;

        /**
         * 版本
         */
        public String version;

    }

    /**
     * ifm组件是否启动参数类
     */
    @Setter
    public static class ComponentEnabled {
        /**
         * 是否开启swagger文档
         */
        public Boolean swagger;

        /**
         * 是否开启权限限制
         */
        public Boolean dataAuth;

        /**
         * 是否开启自定义校验器
         */
        public Boolean validator;

    }
}
